if x < 100
{
    hspeed = 1;
} 
else if x > room_width - 100
{
    hspeed = -1;
}
